dcmd_megbilincsel(playerid, params[]){if(IsPlayerConnected(playerid)){if (PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pJob] == 27 || PlayerInfo[playerid][szervLeader] == 4 || PlayerInfo[playerid][szervTag] == 4 || PlayerInfo[playerid][pJob] == 27){ tmp = strtok(cmdtext, idx);if(!strlen(tmp)){ if (sscanf(params, \"d\", giveplayerid)) SendClientMessage(playerid, COLOR_GRAD2, \"HASZNÁLAT: /megbilincsel [JátékosID/NévRészlet]\"); return 1;}giveplayerid = ReturnUser(tmp);if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 5) { if(PlayerInfo[playerid][pRank] == 1) { SendClientMessage(playerid, COLOR_GRAD2,\"Kadét ranggal nem bilincselhetsz!\"); return 1; } if(PlayerCuffed[giveplayerid] == 1) { if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GRAD2, \"Magadat nem bilincselheted meg!\"); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(stringx, sizeof(stringx), \"%s megbilincselt.\", sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stringx); format(stringx, sizeof(stringx), \"Megbilincselted %s.\", rag(giveplayer,3)); SendClientMessage(playerid, COLOR_LIGHTBLUE, stringx); format(stringx, sizeof(stringx), \"* %s elõvesz egy bilincset és megbilincseli %s.\", sendername ,rag(giveplayer,3)); ProxDetector(30.0, playerid, stringx, COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT); GameTextForPlayer(giveplayerid, \"~r~Megbilincseltek\", 2500, 3); TogglePlayerControllable(giveplayerid,0); PlayerInfo[giveplayerid][bilincs] = 1; PlayerCuffed[giveplayerid] = 2; PlayerCuffedTime[giveplayerid] = 300; SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED); SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000); } else SendClientMessage(playerid, COLOR_GRAD2, \"Elõször sokkold le az illetõt!\"); } else SendClientMessage(playerid, COLOR_GRAD2, \"A játékos nincs a közeledben!\"); } else SendClientMessage(playerid, COLOR_GRAD2, \"Nincs ilyen játékos!\");}else{ SendClientMessage(playerid, COLOR_GRAD2, \"Nincs ilyen játékos!\");}}else SendClientMessage(playerid, COLOR_GRAD2, \"Nem vagy rendõr/swatos/testõr!\");}return 1;}
public OnPlayerCommandText(playerid, cmdtext[]){dcmd(megbilincsel, 12 , cmdtext);return 0;}
dcmd_megbilincsel (playerid, params[]){if(IsPlayerConnected(playerid)){if (PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pJob] == 27 || PlayerInfo[playerid][szervLeader] == 4 || PlayerInfo[playerid][szervTag] == 4 || PlayerInfo[playerid][pJob] == 27){ tmp = strtok(cmdtext, idx);if(!strlen(tmp)){ if (sscanf(params, \"d\", giveplayerid)) SendClientMessage(playerid, COLOR_GRAD2, \"HASZNÁLAT: /megbilincsel [JátékosID/NévRészlet]\"); return 1;}giveplayerid = ReturnUser(tmp);if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 5) { if(PlayerInfo[playerid][pRank] == 1) { SendClientMessage(playerid, COLOR_GRAD2,\"Kadét ranggal nem bilincselhetsz!\"); return 1; } if(PlayerCuffed[giveplayerid] == 1) { if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GRAD2, \"Magadat nem bilincselheted meg!\"); return 1; } GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(stringx, sizeof(stringx), \"%s megbilincselt.\", sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stringx); format(stringx, sizeof(stringx), \"Megbilincselted %s.\", rag(giveplayer,3)); SendClientMessage(playerid, COLOR_LIGHTBLUE, stringx); format(stringx, sizeof(stringx), \"* %s elõvesz egy bilincset és megbilincseli %s.\", sendername ,rag(giveplayer,3)); ProxDetector(30.0, playerid, stringx, COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT); GameTextForPlayer(giveplayerid, \"~r~Megbilincseltek\", 2500, 3); TogglePlayerControllable(giveplayerid,0); PlayerInfo[giveplayerid][bilincs] = 1; PlayerCuffed[giveplayerid] = 2; PlayerCuffedTime[giveplayerid] = 300; SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED); SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000); } else SendClientMessage(playerid, COLOR_GRAD2, \"Elõször sokkold le az illetõt!\"); } else SendClientMessage(playerid, COLOR_GRAD2, \"A játékos nincs a közeledben!\"); } else SendClientMessage(playerid, COLOR_GRAD2, \"Nincs ilyen játékos!\");}else{ SendClientMessage(playerid, COLOR_GRAD2, \"Nincs ilyen játékos!\");}}else SendClientMessage(playerid, COLOR_GRAD2, \"Nem vagy rendõr/swatos/testõr!\");}return 1;}
ez nem dcmd parancs hanem strcmp -s szóval írd át majd new giveplayerid; a parancshoz.
dcmd_megbilincsel (playerid, params[]){ if(IsPlayerConnected(playerid)) { if (PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 9 || PlayerInfo[playerid][pMember] == 9 || PlayerInfo[playerid][pJob] == 27 || PlayerInfo[playerid][szervLeader] == 4 || PlayerInfo[playerid][szervTag] == 4 || PlayerInfo[playerid][pJob] == 27) { new giveplayerid; if (sscanf(params, \"d\", giveplayerid)) SendClientMessage(playerid, COLOR_GRAD2, \"HASZNÁLAT: /megbilincsel [JátékosID/NévRészlet]\"); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(GetDistanceBetweenPlayers(playerid,giveplayerid) < 5) { if(PlayerInfo[playerid][pRank] == 1) { SendClientMessage(playerid, COLOR_GRAD2,\"Kadét ranggal nem bilincselhetsz!\"); return 1; } if(PlayerCuffed[giveplayerid] == 1) { if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GRAD2, \"Magadat nem bilincselheted meg!\"); return 1; } new giveplayer[24]; GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer)); GetPlayerName(playerid, sendername, sizeof(sendername)); format(stringx, sizeof(stringx), \"%s megbilincselt.\", sendername); SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, stringx); format(stringx, sizeof(stringx), \"Megbilincselted %s.\", rag(giveplayer,3)); SendClientMessage(playerid, COLOR_LIGHTBLUE, stringx); format(stringx, sizeof(stringx), \"* %s elõvesz egy bilincset és megbilincseli %s.\", sendername ,rag(giveplayer,3)); ProxDetector(30.0, playerid, stringx, COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT,COLOR_SCRIPTERCHAT); GameTextForPlayer(giveplayerid, \"~r~Megbilincseltek\", 2500, 3); TogglePlayerControllable(giveplayerid,0); PlayerInfo[giveplayerid][bilincs] = 1; PlayerCuffed[giveplayerid] = 2; PlayerCuffedTime[giveplayerid] = 300; SetPlayerSpecialAction(giveplayerid, SPECIAL_ACTION_CUFFED); SetPlayerAttachedObject(giveplayerid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977, -81.700035, 0.891999, 1.000000, 1.168000); } else SendClientMessage(playerid, COLOR_GRAD2, \"Elõször sokkold le az illetõt!\"); } else SendClientMessage(playerid, COLOR_GRAD2, \"A játékos nincs a közeledben!\"); } else SendClientMessage(playerid, COLOR_GRAD2, \"Nincs ilyen játékos!\"); } else { SendClientMessage(playerid, COLOR_GRAD2, \"Nincs ilyen játékos!\"); } } else SendClientMessage(playerid, COLOR_GRAD2, \"Nem vagy rendõr/swatos/testõr!\"); } return 1;}