SA-MP Forums Archive
Command Problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Command Problem (/showthread.php?tid=389913)



Command Problem - Jay_Dixon - 04.11.2012

First ones the error, second ones the scripting. I've written it out the exact same way as the other cmds are, and the script gives no problem. But with THIS command, the script decides to throw a bitch fit and not compile. What am i doing wrong D:

F:\Jay Vortex 2 Script (FCRP)\gamemodes\vx-rp.pwn(9246) : error 001: expected token: ")", but found "return"


Код:
CMD:mwalk(playerid, params[]) {
	if(GetPlayerState(playerid != 1) return SendClientMessage(playerid, COLOR_GREY, "You can only use this animation while on foot.");
	if(playerVariables[playerid][pFreezeTime] !=0) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while cuffed, tazed, or frozen.");
	if(playerVariables[playerid][pEvent] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while in an event.");
	ApplyAnimation(playerid,"PED","WALK_player",4.1,1,1,1,1,1);
	return 1;
}



Re: Command Problem - Swyft™ - 04.11.2012

Quote:
Originally Posted by Jay_Dixon
Посмотреть сообщение
First ones the error, second ones the scripting. I've written it out the exact same way as the other cmds are, and the script gives no problem. But with THIS command, the script decides to throw a bitch fit and not compile. What am i doing wrong D:

F:\Jay Vortex 2 Script (FCRP)\gamemodes\vx-rp.pwn(9246) : error 001: expected token: ")", but found "return"


Код:
CMD:mwalk(playerid, params[]) {
	if(GetPlayerState(playerid != 1) return SendClientMessage(playerid, COLOR_GREY, "You can only use this animation while on foot.");
	if(playerVariables[playerid][pFreezeTime] !=0) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while cuffed, tazed, or frozen.");
	if(playerVariables[playerid][pEvent] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while in an event.");
	ApplyAnimation(playerid,"PED","WALK_player",4.1,1,1,1,1,1);
	return 1;
}
pawn Код:
CMD:mwalk(playerid, params[]) {
    if(GetPlayerState(playerid != 1) return SendClientMessage(playerid, COLOR_GREY, "You can only use this animation while on foot.");
    if(playerVariables[playerid][pFreezeTime] !=0) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while cuffed, tazed, or frozen.");
    if(playerVariables[playerid][pEvent] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while in an event.");
    ApplyAnimation(playerid,"PED","WALK_player",4.1,1,1,1,1,1,1);
    return 1;
}
Try that...


Re: Command Problem - s0nic - 04.11.2012

Your problem is here:
pawn Код:
if(GetPlayerState(playerid != 1)
You missed a ) after playerid..so simply change it to this:
pawn Код:
if(GetPlayerState(playerid) != 1)



Re: Command Problem - KevinPRINCE - 04.11.2012

NVM but next time label it


Re: Command Problem - Swyft™ - 04.11.2012

pawn Код:
CMD:mwalk(playerid, params[]) {
    if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "You can only use this animation while on foot.");
    if(playerVariables[playerid][pFreezeTime] !=0) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while cuffed, tazed, or frozen.");
    if(playerVariables[playerid][pEvent] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can't use animations while in an event.");
    ApplyAnimation(playerid,"PED","WALK_PLAYER",4.1,1,1,1,1,1,1);
    return 1;
}
Ignore what I posted above, this compiled fine on my script


Re: Command Problem - Jay_Dixon - 04.11.2012

Thanks, it worked, i didn't catch that small mistake there o.O


Re: Command Problem - Swyft™ - 04.11.2012

It's all good, we all make stupid mistakes!