if(strcmp(cmd, "/start", true) == 0)//start
{
if(IsPlayerConnected(playerid))
{
if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0))
if(newkeys == KEY_JUMP)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), " %s has attempted to Start the vehicle", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
printf("%s", string);
EnterCarTime[playerid] += 1;
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a Vehicle!");
return 1;
}
}
}
if(strcmp(cmd,"/stop", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInAnyVehicle(playerid))
{
new VID;
VID = GetPlayerVehicleID(playerid);
if(CarRunning[VID] == 1)
{
GetPlayerName(playerid,sendername,sizeof(sendername));
format(string, sizeof(string), "** %s Turns Their Car off.",sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
TogglePlayerControllable(playerid, 0);
CarRunning[VID] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREY, " Your car is already off.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not in a car !");
return 1;
}
}
}
if(EnterCarTime[i] >= 1)//start
{
EnterCarTime[i] += 1;
VID = GetPlayerVehicleID(i);
GetVehicleHealth(VID, Vehhp);
if(EnterCarTime[i] == 3)
{
if(CarWires[VID] == 0 && Vehhp > 400 && Gas[VID] > 3)
{
SendClientMessage(i, TEAM_GROVE_COLOR, " The engine is now running, Drive Safely");
TogglePlayerControllable(i, 1);
CarRunning[VID] = 1;
EnterCarTime[i] = 0;
}
else
{
SendClientMessage(i, COLOR_RED," You failed to start your car ");
SendClientMessage(i, COLOR_RED, " Check your engine!");
EnterCarTime[i] = 0;
}
}
}
if(CarRunning[newcar] == 0)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(IsABicyle(newcar))
{
SendClientMessage(playerid, COLOR_PURPLE, "Status: Ready to ride.");
return 1;
}
if(IsARC(vehicleid))
{
SendClientMessage(playerid, COLOR_PURPLE, "Status: Ready to drive.");
return 1;
}
TogglePlayerControllable(playerid, 0);
SendClientMessage(playerid, COLOR_PURPLE, "Status: To start the engine, Switch the car keys by(Shift Key)OR(/engine)");
}
if(CarRunning[newcar] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTGREEN, "Status: The engine is Running ");
}
if(CarWires[newcar] != 0)
{
SendClientMessage(playerid, COLOR_RED, "Status: Ignition wires are damaged ");
}
if(Vehhp <= 400)
{
SendClientMessage(playerid, COLOR_RED, "Status: **Engine light indicates** Engine Repairs needed.");
ShowPlayerDialog(playerid, MECHANICMENU, DIALOG_STYLE_LIST, "What would you like to do?","Call Mechanic\nExit Vehicle ", "Select", "Cancel");
}
if(Gas[newcar] < 4)
{
SendClientMessage(playerid, COLOR_RED, " Status: **Fuel Light Indicates** Re-Fill needed. ");
ShowPlayerDialog(playerid, MECHANICMENU, DIALOG_STYLE_LIST, "What would you like to do?","Call Mechanic\nExit Vehicle ", "Select", "Cancel");
}
if(IsABoat(newcar))
{
if(PlayerInfo[playerid][pBoatLic] < 1)
{
SendClientMessage(playerid, COLOR_GREY, " You don't know how to Sail yet, so you left the Boat !");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
}
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
{
if(IsPlayerConnected(playerid))
{
if (PlayerInfo[playerid][pMember] == 8 && PlayerInfo[playerid][pLeader] == 8)
{
if(PlayerInfo[playerid][pC4Used] == 0)
{
CreateExplosion(bx, by, bz, 7, 4);
PickUpC4(playerid);
PlayerInfo[playerid][pC4Used] = 1;
}
}
new string[128];
if(editingcdvehpos[playerid])
{
TogglePlayerControllable(playerid, false);
format(string,256,"Is this the new position you want?.");
ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel");
}
if(editingcdvehnew[playerid])
{
TogglePlayerControllable(playerid, false);
format(string,256,"Is this the new position you want?.");
ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel");
}
}
}
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0)) { if(newkeys == KEY_JUMP) { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " %s has attempted to Start the vehicle", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); printf("%s", string); EnterCarTime[playerid] += 1; return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You are not in a Vehicle!"); return 1; } } if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys)) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pMember] == 8 && PlayerInfo[playerid][pLeader] == 8) { if(PlayerInfo[playerid][pC4Used] == 0) { CreateExplosion(bx, by, bz, 7, 4); PickUpC4(playerid); PlayerInfo[playerid][pC4Used] = 1; } } new string[128]; if(editingcdvehpos[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } if(editingcdvehnew[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } } } return 1; }
Originally Posted by Etch ❽ H
try this :
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0)) { if(newkeys == KEY_JUMP) { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " %s has attempted to Start the vehicle", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); printf("%s", string); EnterCarTime[playerid] += 1; return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You are not in a Vehicle!"); return 1; } } if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys)) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pMember] == 8 && PlayerInfo[playerid][pLeader] == 8) { if(PlayerInfo[playerid][pC4Used] == 0) { CreateExplosion(bx, by, bz, 7, 4); PickUpC4(playerid); PlayerInfo[playerid][pC4Used] = 1; } } new string[128]; if(editingcdvehpos[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } if(editingcdvehnew[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } } } return 1; } |
C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4247) : error 017: undefined symbol "sendername" C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4247) : error 017: undefined symbol "sendername" C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4247) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4247) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0)) { if(newkeys == KEY_JUMP) { new sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " %s has attempted to Start the vehicle", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); printf("%s", string); EnterCarTime[playerid] += 1; return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You are not in a Vehicle!"); return 1; } } if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys)) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pMember] == 8 && PlayerInfo[playerid][pLeader] == 8) { if(PlayerInfo[playerid][pC4Used] == 0) { CreateExplosion(bx, by, bz, 7, 4); PickUpC4(playerid); PlayerInfo[playerid][pC4Used] = 1; } } new string[128]; if(editingcdvehpos[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } if(editingcdvehnew[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } } } return 1; }
new sendername[MAX_PLAYER_NAME];
Originally Posted by Etch ❽ H
add this under OnPlayerKeyStateChange
Код:
new sendername[MAX_PLAYER_NAME]; |
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new sendername[MAX_PLAYER_NAME]; if((GetPlayerState(playerid) == PLAYER_STATE_DRIVER) && (PlayerFrozen[playerid] == 0) && (PlayerInfo[playerid][pLocked] == 0)) { if(newkeys == KEY_JUMP) { new sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), " %s has attempted to Start the vehicle", sendername); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); printf("%s", string); EnterCarTime[playerid] += 1; return 1; } else { SendClientMessage(playerid, COLOR_GREY, " You are not in a Vehicle!"); return 1; } } if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys)) { if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pMember] == 8 && PlayerInfo[playerid][pLeader] == 8) { if(PlayerInfo[playerid][pC4Used] == 0) { CreateExplosion(bx, by, bz, 7, 4); PickUpC4(playerid); PlayerInfo[playerid][pC4Used] = 1; } } new string[128]; if(editingcdvehpos[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } if(editingcdvehnew[playerid]) { TogglePlayerControllable(playerid, false); format(string,256,"Is this the new position you want?."); ShowPlayerDialog(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:",string,"Ok","Cancel"); } } } return 1; }
C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4248) : warning 219: local variable "sendername" shadows a variable at a preceding level C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4250) : error 017: undefined symbol "string" C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4250) : error 017: undefined symbol "string" C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4250) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrator\щемзп дтбегд\SunRise Roleplay\gamemodes\srrp.pwn(4250) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.