PDA

View Full Version : Command


Inon
04-12-2009, 06:35 AM
Hi!

This code doesn't works. I dont know why. Can somebody helps me?



function CallPlayer(PlayerID,TargetID)
if getPlayerCellPhoneStatus ( PlayerID ) == 1 then
outputChatBox(PlayerID,"je belt al...",255,0,0,255) return end

if TargetID == nil then
outputChatBox(PlayerID,"- /call [ID]",255,0,0,255) return end
if isPlayerConnected(TargetID) == 0 then
outputChatBox(PlayerID,"verkeerd nummer...",255,0,0,255) return end

if getPlayerCellPhoneStatus ( TargetID ) == 1 then
outputChatBox(PlayerID,"in gesprek...",255,0,0,255) return end

setPlayerCellPhoneStatus (playerID, 1)
setPlayerCellPhoneStatus (targetID, 1)

end

addCommand("call","CallPlayer")

Mex
04-12-2009, 06:53 AM
function CallPlayer(PlayerID,TargetID)
if getPlayerCellPhoneStatus ( PlayerID ) == 1 then
outputChatBox(PlayerID,"je belt al...",255,0,0,255)
return
end
if TargetID == nil then
outputChatBox(PlayerID,"- /call [ID]",255,0,0,255)
return
end
if isPlayerConnected(TargetID) == 0 then
outputChatBox(PlayerID,"verkeerd nummer...",255,0,0,255)
return
end
if getPlayerCellPhoneStatus ( TargetID ) == 1 then
outputChatBox(PlayerID,"in gesprek...",255,0,0,255)
setPlayerCellPhoneStatus (PlayerID, 1)
setPlayerCellPhoneStatus (TargetID, 1)
end
end
addCommand("call","CallPlayer")

personally i find it easier to script like this:

function CallPlayer(PlayerID,TargetID)
if getPlayerCellPhoneStatus ( PlayerID ) == 1 then
outputChatBox(PlayerID,"je belt al...",255,0,0,255)
elseif TargetID == nil then
outputChatBox(PlayerID,"- /call [ID]",255,0,0,255)
elseif isPlayerConnected(TargetID) == 0 then
outputChatBox(PlayerID,"verkeerd nummer...",255,0,0,255)
elseif getPlayerCellPhoneStatus ( TargetID ) == 1 then
outputChatBox(PlayerID,"in gesprek...",255,0,0,255)
setPlayerCellPhoneStatus (PlayerID, 1)
setPlayerCellPhoneStatus (TargetID, 1)
end
end
addCommand("call","CallPlayer")

Inon
04-12-2009, 07:00 AM
Ok, maybe it's easier. But it still doesn't works.

Mex
04-12-2009, 07:09 AM
function CallPlayer(PlayerID,TargetID)
TargetID = tonumber(TargetID)
if getPlayerCellPhoneStatus ( PlayerID ) == 1 then
outputChatBox(PlayerID,"je belt al...",255,0,0,255)
elseif TargetID == nil then
outputChatBox(PlayerID,"- /call [ID]",255,0,0,255)
elseif isPlayerConnected(TargetID) == 0 then
outputChatBox(PlayerID,"verkeerd nummer...",255,0,0,255)
elseif getPlayerCellPhoneStatus ( TargetID ) == 1 then
outputChatBox(PlayerID,"in gesprek...",255,0,0,255)
setPlayerCellPhoneStatus (PlayerID, 1)
setPlayerCellPhoneStatus (TargetID, 1)
end
end
addCommand("call","CallPlayer")

Inon
04-12-2009, 12:44 PM
Thank you!

Raul_[BR]
08-10-2009, 03:16 PM
lol,is a cell phone command XD

[NoN]Bruno
08-11-2009, 11:34 AM
;2038406']lol,is a cell phone command XD

Whats so funny about it? I dont find it funny at all.

Explain to me why its funny, please

Xeonon
08-11-2009, 05:14 PM
He is just trying to post random posts from topics very old!