17.04.2009, 13:15
Hello i can you tel me why this work.
And this dont work
______________________________________
Full script
And this is one who dont work
Код:
if(strcmp(cmd,"/seatbelt",true)==0) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { SendClientMessage(playerid,COLOR_GREY,"You are not in any vehicle"); return 1; } if(PlayerInfo[playerid][pSeatBelt] == 1) { PlayerInfo[playerid][pSeatBelt] = 0; return 1; }
Код:
public OnPlayerExitVehicle(playerid, vehicleid) { if(PlayerInfo[playerid][pSeatBelt] == 1) { PlayerInfo[playerid][pSeatBelt] = 0; return 1; }
Full script
Код:
if(strcmp(cmd,"/seatbelt",true)==0) { if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { SendClientMessage(playerid,COLOR_GREY,"You are not in any vehicle"); return 1; } if(PlayerInfo[playerid][pSeatBelt] == 1) { PlayerInfo[playerid][pSeatBelt] = 0; GetPlayerName(playerid, sendername, sizeof(sendername)); new stringtosee[255]; new ftext[255]; if(PlayerInfo[playerid][pSex] == 1) { ftext = "his"; } else if(PlayerInfo[playerid][pSex] == 1) { ftext = "her"; } format(stringtosee, sizeof(stringtosee), "* %s unbuckles %s seat belt", sendername , ftext); ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA); return 1; } PlayerInfo[playerid][pSeatBelt] = 1; GetPlayerName(playerid, sendername, sizeof(sendername)); new stringtosee[255]; new ftext[255]; if(PlayerInfo[playerid][pSex] == 1) { ftext = "his"; } else if(PlayerInfo[playerid][pSex] == 1) { ftext = "her"; } format(stringtosee, sizeof(stringtosee), "* %s buckles %s seat belt", sendername , ftext); ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA); return 1; }
Код:
public OnPlayerExitVehicle(playerid, vehicleid) { if(PlayerInfo[playerid][pSeatBelt] == 1) { PlayerInfo[playerid][pSeatBelt] = 0; new stringtosee[255]; new sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); new ftext[255]; if(PlayerInfo[playerid][pSex] == 1) { ftext = "his"; } else if(PlayerInfo[playerid][pSex] == 1) { ftext = "her"; } format(stringtosee, sizeof(stringtosee), "* %s unbuckles %s seat belt", sendername , ftext); ProxDetector(30.0, playerid, stringtosee, 0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA,0xC2A2DAAA); return 1; } return 1; }