Command Problem
#1

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;
}
Reply
#2

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...
Reply
#3

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)
Reply
#4

NVM but next time label it
Reply
#5

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
Reply
#6

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)